<template>
  <el-form label-width="120px">
    <el-form-item label="营业执照">
      <img :src="shopgetinfo.license" alt="" style="width:70px;hright:70px" v-if="MuchShow==false">
      <single-upload v-model="shopgetinfo.license" style="display: inline-block;margin-left: 10px" v-if="MuchShow==true" />
    </el-form-item>
    <el-form-item label="身份证正面(国徽)">
        <img :src="shopgetinfo.idCardFront" alt="" style="width:70px;hright:70px" v-if="MuchShow==false">
      <single-upload v-model="shopgetinfo.idCardFront" style="display: inline-block;margin-left: 10px" v-if="MuchShow==true" />
    </el-form-item>
    <el-form-item label="身份证反面">
        <img :src="shopgetinfo.idCardBack" alt="" style="width:70px;hright:70px" v-if="MuchShow==false">
      <single-upload v-model="shopgetinfo.idCardBack" style="display: inline-block;margin-left: 10px" v-if="MuchShow==true"/>
    </el-form-item>
    <!-- <el-form-item label="银行卡/开户证明">
    <img :src="shopgetinfo.bankinfoPhoto" alt="" style="width:70px;hright:70px" v-if="MuchShow==false">
      <single-upload v-model="shopgetinfo.bankinfoPhoto" style="display: inline-block;margin-left: 10px" v-if="MuchShow==true"/>
    </el-form-item> -->
    <el-form-item label="店面门头照">
        <img :src="shopgetinfo.thedoor" alt="" style="width:70px;hright:70px" v-if="MuchShow==false">
      <single-upload v-model="shopgetinfo.thedoor" style="display: inline-block;margin-left: 10px" v-if="MuchShow==true"/>
    </el-form-item>
    <el-form-item label="食品经营许可证">
        <img :src="shopgetinfo.food" alt="" style="width:70px;hright:70px" v-if="MuchShow==false">
      <single-upload v-model="shopgetinfo.food" style="display: inline-block;margin-left: 10px" v-if="MuchShow==true"/>
    </el-form-item>
    <el-form-item label="店内场景照">
        <img :src="shopgetinfo.scene" alt="" style="width:70px;hright:70px" v-if="MuchShow==false">
      <single-upload v-model="shopgetinfo.scene" style="display: inline-block;margin-left: 10px" v-if="MuchShow==true"/>
    </el-form-item>
    <!-- <el-form-item label="推广者合照">
        <img :src="shopgetinfo.promoterPhoto" alt="" style="width:70px;hright:70px" v-if="MuchShow==false">
      <single-upload v-model="shopgetinfo.promoterPhoto" style="display: inline-block;margin-left: 10px" v-if="MuchShow==true"/>
    </el-form-item> -->
    <!-- <el-form-item label="其他辅助材料">
        <img :src="shopgetinfo.otherPhoto" alt="" style="width:70px;hright:70px" v-if="MuchShow==false">
      <single-upload v-model="shopgetinfo.otherPhoto" style="display: inline-block;margin-left: 10px" v-if="MuchShow==true"/>
    </el-form-item> -->
    <!-- <el-form-item label="公众号二维码">
        <img :src="shopgetinfo.qrcode" alt="" style="width:70px;hright:70px" v-if="MuchShow==false">
      <single-upload v-model="shopgetinfo.qrcode" style="display: inline-block;margin-left: 10px" v-if="MuchShow==true"/>
    </el-form-item> -->

    <!-- <el-form-item>
      <el-button :loading="loading" type="primary" @click.native.prevent="submit" v-permission="['parameter.edit']"  v-if="MuchShow==true">修改</el-button>
    </el-form-item> -->
  </el-form>
</template>
<script>
import { updateMchShop } from '@/api/sysSetUp'
import singleUpload from '@/components/Upload/singleUpload'
import permission from '@/directive/permission/index.js' // 权限判断指令
export default {
  components: { singleUpload },
  directives: { permission },
   props: {
    shopgetinfo: {
      type: Object,
    },
    MuchShow:{
      type:Boolean
    }
  },
  data() {
    return {
      loading: false // 按钮防双击
    }
  },
  methods: {
    submit() {
      var _this=this
      this.loading = true
      updateMchShop(this.shopgetinfo).then(res => {
        console.log(res)
        this.loading = false
        this.$message.success('修改成功')
            _this.$store.dispatch('tagsView/delView', _this.$route).then(({ visitedViews }) => {
                  _this.$router.push({
                    path: '/sysMch/list'
                  })
                })// 关闭当前tab回到列表
      }).catch(err => {
           this.loading = false
      })
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
